package com.xieshue.im.client;

/**
 * 客户端连接配置
 *
 * @author xieshue
 * @date 2017\12\28 0028
 */
public class ConnectConfig {
    /**
     * 地址
     */
    private String host;
    /**
     * 端口
     */
    private int port;

    public ConnectConfig(int port) {
        this(null, port);
    }

    public ConnectConfig(String host, int port) {
        String h = host;
        int p = port;
        if (h == null || h.trim().length() == 0) {
            h = "127.0.0.1";
        }
        if (p < 1) {
            p = 8080;
        }
        this.host = h;
        this.port = p;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }
}
